#!/bin/bash
###SHELLPACK preamble scimarkc-install 2_1c
WEB_LOCATION="https://math.nist.gov/scimark2"
MIRROR_LOCATION="$WEBROOT/scimarkc"

###SHELLPACK parseargBegin
###SHELLPACK parseargInstall
###SHELLPACK parseargEnd

ZIPFILE="scimark${VERSION}.zip"
sources_fetch $WEB_LOCATION/$ZIPFILE $MIRROR_LOCATION/$ZIPFILE $SHELLPACK_SOURCES/$ZIPFILE
cd $SHELLPACK_SOURCES || die Sources directory does not exist
rm -rf scimarkc-${VERSION}-installed
mkdir scimarkc-${VERSION}-installed
cd scimarkc-${VERSION}-installed || die "Failed to create directory"
unzip $SHELLPACK_SOURCES/$ZIPFILE || die "Failed to extract archive"
make || die "Failed to build scimark ${VERSION}"

exit $SHELLPACK_SUCCESS
